package com.weixing.mall.pay.channel.ali;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.annotation.JSONField;
import com.google.common.collect.Maps;
import com.weixing.mall.pay.NotifyResp;
import lombok.Data;

import java.math.BigDecimal;
import java.util.Map;

/**
 * @ClassName WxNotifyResp
 * @Description 支付宝支付异步通知返回参数
 * @Author Small
 * @Date 2019/12/4 14:57
 * @Version 1.0
 **/
@Data
public class AliNotifyResp implements NotifyResp{
    /**
     * 通知时间  yyyy-MM-dd HH:mm:ss
     */
    @JSONField(name = "notify_time")
    private String notifyTime;
    /**
     * 通知类型
     */
    @JSONField(name = "notify_type")
    private String notifyType;
    /**
     * 通知校验ID
     */
    @JSONField(name ="notify_id")
    private String notifyId;
    /**
     * 开发者的app_id
     */
    @JSONField(name ="app_id")
    private String appId;

    /**
     * 编码格式
     */
    private String charset;
    /**
     * 接口版本
     */
    private String version;
    /**
     * 签名类型
     */
    @JSONField(name ="sign_type")
    private String signType;

    /**
     * 签名
     */
    private String sign;
    /**
     * 支付宝交易号
     */
    @JSONField(name ="trade_no")
    private String tradeNo;
    /**
     * 商户订单号
     */
    @JSONField(name ="out_trade_no")
    private String outTradeNo;
    /**
     * 商户业务号
     */
    @JSONField(name ="out_biz_no")
    private String outBizNo;
    /**
     * 买家支付宝用户号
     */
    @JSONField(name ="buyer_id")
    private String buyerId;
    /**
     * 买家支付宝账号
     */
    @JSONField(name ="buyer_logon_id")
    private String buyerLogonId;

    /**
     * 卖家支付宝用户号
     */
    @JSONField(name ="seller_id")
    private String sellerId;


    /**
     * 卖家支付宝账号
     */
    @JSONField(name ="seller_email")
    private String sellerEmail;

    /**
     * 交易状态
     */
    @JSONField(name ="trade_status")
    private String tradeStatus;


    /**
     * 订单金额(元)
     */
    @JSONField(name ="total_amount")
    private BigDecimal totalAmount;

    /**
     * 实收金额
     */
    @JSONField(name ="receipt_amount")
    private BigDecimal receiptAmount;


    /**
     * 开票金额
     */
    @JSONField(name ="invoice_amount")
    private BigDecimal invoiceAmount;


    /**
     * 付款金额
     */
    @JSONField(name ="buyer_pay_amount")
    private BigDecimal buyerPayAmount;


    /**
     * 集分宝金额
     */
    @JSONField(name ="point_amount")
    private BigDecimal pointAmount;

    /**
     * 总退款金额
     */
    @JSONField(name ="refund_fee")
    private BigDecimal refundFee;


    public static void main(String[] args) {
        Map<String,String> params = Maps.newHashMap();
        params.put("app_id","123456");
        AliNotifyResp notifyResponse = JSON.parseObject(JSON.toJSONString(params), AliNotifyResp.class);
        System.out.println(JSON.toJSONString(notifyResponse));
    }
}
